/*!
 * \file manager.h
 * \brief Header of classes CMeshManager, CTextureManager, CSoundManager and CGlobalManager
 * \author Benjamin Toueg
 * \version 20.05.09
 */

#ifndef MESHMANAGER_H
#define MESHMANAGER_H

#include "meshloader.h"

#include "vector3.h"

#include <string>
#include <map>

class CMeshManager
{
public:
    CMeshManager() {};
    ~CMeshManager() {};
    void changeDrawingType(const ogl::CDrawingType::eBehaviour& eType);
    GLuint createBoxDisplayList(const Vector3d& center);
    CMeshObj* getMeshPtr(const std::string& mesh_name);
    void loadAllMesh();

private:
    std::map<std::string,CMeshObj> m_mesh_map;
};

#endif //MESHMANAGER_H

#ifndef TEXTUREMANAGER_H
#define TEXTUREMANAGER_H

#include <GL/glew.h>
#include <SFML/Graphics.hpp>

class CTextureManager
{
public:
    CTextureManager();
    ~CTextureManager();
    void bindTexture(const std::string& mesh_name);
    std::map<int,sf::Image>* getMapTextureBoxes() { return &map_texture_boxes; };
    std::map<std::pair<int,int>,sf::Image>* getMapTextureCTiles() { return &map_texture_tiles; };
    void loadAllTexture();

private:
    // ci-après les textures UV
    std::map<std::string,sf::Image> m_texture_map;
    // ci-après les textures des cases
    std::map<int,sf::Image> map_texture_boxes;
    std::map<std::pair<int,int>,sf::Image> map_texture_tiles;
};

#endif //TEXTUREMANAGER_H

#ifndef SOUNDMANAGER_H
#define SOUNDMANAGER_H

#include <SFML/Audio.hpp>

class CSoundManager
{
public:
    CSoundManager();
    ~CSoundManager();
    void loadAllBuffer();
    void pauseMusic();
    void play(const std::string&);
    void play(int n);
    void playMusic();
    void stopMusic();

private:
    std::map<std::string,sf::SoundBuffer> m_buffer_map;
    sf::Sound m_sound1;
    sf::Music m_music;
    // les melodies
    std::vector<std::string> m_auclairdelalune;
};

#endif //SOUNDMANAGER_H

#ifndef GLOBALMANAGER_H
#define GLOBALMANAGER_H

class CGlobalManager: public CMeshManager, public CTextureManager, public CSoundManager
{
public:
    CGlobalManager():CMeshManager(),CTextureManager(),CSoundManager() {};
    ~CGlobalManager() {};
};

#endif // GLOBALMANAGER_H
